#ifndef __MU_PDF_MANAGER__
#define __MU_PDF_MANAGER__

extern "C"{
#include "fitz.h"
#include "mupdf.h"
}

#ifdef __WXMAC__
#include "OpenGL/gl.h"
#else
#include <GL/gl.h>
#endif

#include "Logger.h"


class MuPDFManager
{
  private:
        char* filename;
        char* doctitle;
        
        pdf_xref *xref;
        pdf_outline *outline;
        pdf_pagetree *pages_tree;
        pdf_page *page;
        fz_renderer *rast;
       	fz_obj *obj;
   		fz_pixmap *image;
        int current_page_num;
        int page_num;
        
        float zoom;
        int rotate;
        int shrinkwrap;
        int panx,pany;
        
        Logger* logger;
        
  public:
        MuPDFManager(int width, int height);
        ~MuPDFManager();
        
        int openPDFFile(char* filename);  
        void closePDFFile();
        int getTotalPageNum();
        GLuint* loadImage(int page_num, int* imageWidth,int* imageHeight, int* textureWidth, int* textureHeight);
};
#endif
